package myta.bean;

import java.util.ArrayList;
import java.util.List;

import myta.model.DataTable;
import myta.service.Command;
import myta.service.SQLexec;
import myta.service.Utility;
	
public class Session {
	private boolean isNew;
	
	private String idadmin;
	private String namaadmin;
	private boolean isLogin = false;
	
	private DataTable tableDetailSiswaKelas;
	private List<DataAnalisa> listAnalis;
	private List<DataRaport> listRaport;
	
	public Session() {
		try {
			isNew = true;
			loadDetailSiswaKelas();
			listAnalis = new ArrayList<DataAnalisa>();
			listRaport = new ArrayList<DataRaport>();
		} catch (Exception e) {
			Utility.showMessage(e.getMessage());
		}
		
	}
	
	private void loadDetailSiswaKelas() throws Exception{
		String sql = "select nis, concat('') as namasiswa from kelassiswa_detail where idkelassiswa = 'test'";
		Command command = SQLexec.makeCommand(sql);
		tableDetailSiswaKelas = command.executeQuery();
	}
	
	public boolean isNew() {
		return isNew;
	}
	
	public void setNew(boolean isNew) {
		this.isNew = isNew;
	}
	
	public String getIdadmin() {
		return idadmin;
	}
	
	public void setIdadmin(String idadmin) {
		this.idadmin = idadmin;
	}
	
	public String getNamaadmin() {
		return namaadmin;
	}
	
	public void setNamaadmin(String namaadmin) {
		this.namaadmin = namaadmin;
	}

	public boolean isLogin() {
		return isLogin;
	}

	public void setLogin(boolean isLogin) {
		this.isLogin = isLogin;
	}

	public DataTable getTableDetailSiswaKelas() {
		return tableDetailSiswaKelas;
	}

	public void setTableDetailSiswaKelas(DataTable tableDetailSiswaKelas) {
		this.tableDetailSiswaKelas = tableDetailSiswaKelas;
	}

	public List<DataAnalisa> getListAnalis() {
		return listAnalis;
	}

	public void setListAnalis(List<DataAnalisa> listAnalis) {
		this.listAnalis = listAnalis;
	}

	public List<DataRaport> getListRaport() {
		return listRaport;
	}

	public void setListRaport(List<DataRaport> listRaport) {
		this.listRaport = listRaport;
	}
}
